import java.util.Scanner;

/**
 * 计算前N个自然数的和
 * @author zhouzhiheng98@foxmail.com 2020-07-17 16:19:08
 */
public class Sum {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个自然数：");
        int n = scanner.nextInt();
        int sum = ((n + 1) * n)/2;
        System.out.println("前N个自然数的和为："+sum);
    }
}
